package com.shop.cloud.upms.common.feign;

import com.shop.cloud.common.core.constant.SecurityConstants;
import com.shop.cloud.common.core.constant.ServiceNameConstants;
import com.shop.cloud.common.core.util.R;
import com.shop.cloud.upms.common.entity.SysTenant;
import com.shop.cloud.upms.common.entity.SysTenantPackage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import java.util.List;

/**
 * @author
 */
@FeignClient(contextId = "feignTenantService", value = ServiceNameConstants.UMPS_ADMIN_SERVICE)
public interface FeignTenantService {

	/**
	 * 查询租户列表
	 *
	 * @return R
	 */
	@GetMapping("/tenant/inside/list")
	R<List<SysTenant>> list(@RequestHeader(SecurityConstants.FROM) String from);

	/**
	 * 通过租户ID查询租户套餐
	 * @param id
	 * @return
	 */
	@GetMapping("/tenant/inside/package/{id}")
	R<SysTenantPackage> getTenantPackage(@PathVariable("id") String id, @RequestHeader(SecurityConstants.FROM) String from);

	@GetMapping("/tenant/inside/{id}")
	R<SysTenant> getById(@PathVariable("id") String id, @RequestHeader(SecurityConstants.FROM) String from);
}
